home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows News 2010 Summer - Disc 1
/
WN_Ete2010_CD1.iso
/
Onglet5
/
Weezo
/
Weezo setup.exe
/
{code_appDir}
/
www
/
local
/
setLoginMessage.php
< prev
next >
Wrap
PHP Script
|
2010-05-19
|
3KB
|
83 lines
<?php
/**
* Login page personal message
*
*
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category NA
* @package NA
* @author Nicolas Bruley / Peer 2 World <contact@weezo.net>
* @copyright 2005-2009 Nicolas Bruley / Peer 2 World
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id:$
* @link http://www.weezo.net
* @since File available since Release 1.0.0
*/
// Initialize script data
require_once('localFunctions.php');
require_once(INCLUDE_DIR.'applicationConfigFunctions.php');
require_once(INCLUDE_DIR.'outputFunctions.php');
lfInit();
/**
* Process POST command
*/
if(isset($_POST['loginMessage'])){
if($_POST['messageType']=='plain'){
$loginMessage=cfUTF8Decode($_POST['loginMessage'],true,true,true);
$loginMessage=str_replace(cfStrLBPattern($loginMessage),'<br>',$loginMessage);
}
else{
$loginMessage=cfUTF8Decode($_POST['loginMessage'],true,true,false);
$loginMessage=str_replace(cfStrLBPattern($loginMessage),'',$loginMessage);
}
cfGUpdateVar("loginMessage",$loginMessage,true);
cfInsertHEAD(false);
echo '</head><body><script language="javascript" type="text/javascript">wl.UICommand(\'close\')</script>';
exit;
}
else{
$loginMessage=cfGGetVar('loginMessage');
}
// detect if message is HTML formated
$isHTML=(strpos(str_ireplace('<br>','',str_ireplace('<br />','',str_ireplace('<br/>','',$loginMessage))),'<')!==false);
// If not so, replace br by \n
if(!$isHTML) $loginMessage=str_ireplace('<br>',"\n",str_ireplace('<br />',"\n",str_ireplace('<br/>',"\n",$loginMessage)));
cfInsertHEAD(false);
?>
<meta icon="info"></meta>
<script>
function save(){
dgi('loginMessage').value=dgi('loginMessageTextarea').value;
dgi('loginMessageForm').submit();
}
</script>
</head>
<body width="400" height="230" background="red" scroll="no">
<?php
echo outDivFrame('frame1');
echo '<div class="frame1Header">'.outImage(outIcon('info2'),false,false,'vertical-align:middle;margin-right:1em').cfCaption('loginMessage').'</div><br/>';
echo '<form method="POST" enctype="multipart/form-data" id="loginMessageForm">';
echo '<input type="radio"'.(($isHTML)?'':'checked="checked"').' name="messageType" value="plain">'.cfCaption('plainText').' ';
echo '<input type="radio"'.((!$isHTML)?'':'checked="checked"').' name="messageType" value="HTML">HTML<br/>';
echo '<textarea class="textarea" style="width:100%" rows="5" id="loginMessageTextarea">'.cfUTF8Encode($loginMessage,false,$isHTML).'</textArea>';
echo '<center><br/>';
echo outButton(cfCaption('genOK'),'javascript:save()',outIcon('ok'),false,false,'style="margin-right:2em;"');
echo outButton(cfCaption('genCancel'),'javascript:wl.UICommand(\'close\')',outIcon('cancel'));
echo '</center>';
echo '<input type="hidden" name="loginMessage" id="loginMessage">';
echo '</form>';
echo '</div>';
?>
</body></html>